package com.gxa.finance.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gxa.common.commons.R;
import com.gxa.finance.mapper.RecommendedServiceMapper;
import com.gxa.finance.pojo.RecommendedService;
import com.gxa.finance.service.RecommendedServiceService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

@Service
public class RecommendedServiceServiceImpl implements RecommendedServiceService {
    @Autowired
    private RecommendedServiceMapper recommendedServiceMapper;


    @Override
    public R RecommendedPage(Integer currentPage, Integer pageSize) {
        Page<RecommendedService> page = new Page(currentPage,pageSize);
        Page<RecommendedService> pag = recommendedServiceMapper.selectPage(page, null);
        R r = new R();
        try{if (pag!=null) {
            r.setCode(200);
            r.setMsg("查询成功");
            r.setData(pag);
        }
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
            r.setCode(500);
            r.setMsg("失败");
        }
        return r;
    }
}
